<docs>
  ## input输入元素
</docs>
<template>
  <div class="form-group border-b">
    <label class="input-label" for="">{{label}}</label>
     <textarea :disabled="disabled" @input="$emit('input', $event.target.value)"
     :type="type" :value="value" @blur="validItem" @focus="resetValid" id=""
     :maxlength="maxLength" class="form-control _textarea" :placeholder="placeholder"></textarea>
     <span v-show="money==1" class="dw">元</span>
  </div>
  <!-- <div :class="`weui-cell ${valid === status.REJECTED ? 'weui-cell_warn' : ''}`">
    <div class="weui-cell__hd">
      <label class="weui-label">{{label}}</label>
    </div>
    <div class="weui-cell__bd">
      <input :type="type" class="weui-input" @input="$emit('input', $event.target.value)"
        :value="value" @blur="validItem" @focus="resetValid"
        :maxlength="maxLength" :placeholder="placeholder">
    </div>
    <div class="weui-cell__ft" v-show="valid === status.REJECTED">
      <i class="weui-icon-warn"></i>
    </div>
  </div> -->
</template>
<script>
import { mixinValid } from 'common/mixins/mixins';

export default {
  name: 'co-input',
  props: {
    label: String,
    placeholder: String,
    maxLength: String,
    prop: String,
    value:String,
    money: {
      type: String,
      default: '0'
    },
    rules: Object,
    type: {
      type: String,
      default: 'text'
    },
    disabled: {
      type: Boolean,
      default: false
    },
    value: String,
  },
  mixins: [mixinValid]
};
</script>
<style scoped lang="scss">
@import '~common/scss/variable.scss';
.form-group{
  position: relative;
  .form-control {
    text-align: right;
  }
  .dw{
    position: absolute;
    right: 30px;
  }
}
._textarea{
      box-sizing: border-box;
    display: block;
    width: 100%;
    padding: 0.49259rem 0.78889rem 0.2rem 0.34444rem;
    margin: 0.1rem;
    font-size: 0.38889rem;
    line-height: 1;
    color: #666;
    background-color: #fff;
    background-clip: padding-box;
    border: none;
}
</style>
